#include "aggregate.h"

/*
 * Wrappers around generic functions
 */
int aggregate_single_release(struct inode *inode, struct file *file)
{
AGGREGATE_PRE(AGSOP_RELEASE);
{
int  retval;
	retval= single_release(inode, file);
AGGREGATE_POST(AGSOP_RELEASE);
return retval;
}
}

ssize_t aggregate_simple_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
{
AGGREGATE_PRE(AGSOP_READ);
{
ssize_t  retval;
	retval= simple_transaction_read(file, buf, size, pos);
AGGREGATE_POST(AGSOP_READ);
return retval;
}
}

int aggregate_simple_transaction_release(struct inode *inode, struct file *file)
{
AGGREGATE_PRE(AGSOP_RELEASE);
{
int  retval;
	retval= simple_transaction_release(inode, file);
AGGREGATE_POST(AGSOP_RELEASE);
return retval;
}
}

int aggregate___set_page_dirty_nobuffers(struct page *page)
{
	return __set_page_dirty_nobuffers(page);
}

loff_t aggregate_remote_llseek(struct file *file, loff_t offset, int origin)
{
	return remote_llseek(file, offset, origin);
}

loff_t aggregate_file_llseek(struct file *file, loff_t offset, int origin)
{
	return generic_file_llseek(file, offset, origin);
}

ssize_t aggregate_file_read(struct file *file, char* buf, size_t count, loff_t *ppos)
{
	return generic_file_read(file, buf, count, ppos);
}

ssize_t aggregate_file_write(struct file *file, const char* buf, size_t count, loff_t *ppos)
{
	return generic_file_write(file, buf, count, ppos);
}

ssize_t aggregate_read_dir(struct file *file, char* buf, size_t count, loff_t *ppos)
{
	return generic_read_dir(file, buf, count, ppos);
}

int aggregate_file_mmap(struct file* file, struct vm_area_struct* vemas)
{
	return generic_file_mmap(file, vemas);
}

int aggregate_file_open(struct inode* inode, struct file* filp)
{
	return generic_file_open(inode, filp);
}

int aggregate_commit_write(struct file* filp, struct page* page, unsigned u, unsigned uu)
{
	return generic_commit_write(filp, page, u, uu);
}

int aggregate_block_sync_page(struct page* page)
{
	return block_sync_page(page);
}

// 2.6. only

int aggregate_readlink(struct dentry* d, char __user* u, int i)
{
	return generic_readlink(d, u, i);
}

void aggregate_page_put_link(struct dentry* d, struct nameidata* nd)
{
	page_put_link(d, nd);
}

int aggregate_page_follow_link_light(struct dentry* d, struct nameidata* nd)
{
	return page_follow_link_light(d, nd);
}

ssize_t aggregate_getxattr(struct dentry *d, const char *name, void *buffer, size_t size)
{
        return generic_getxattr(d, name, buffer, size);
}

int aggregate_setxattr(struct dentry *d, const char *name, const void *value, size_t size, int flags)
{
        return generic_setxattr(d, name, value, size, flags);
}

int aggregate_removexattr(struct dentry *d, const char *name)
{
        return generic_removexattr(d, name);
}

ssize_t aggregate_listxattr(struct dentry *d, char *buffer, size_t buffer_size)
{
        return generic_listxattr(d, buffer, buffer_size);
}

ssize_t aggregate_file_sendfile(struct file *in_file, loff_t *ppos, size_t count, read_actor_t actor, void *target)
{
        return generic_file_sendfile(in_file, ppos, count, actor, target);
}
	
ssize_t aggregate_file_aio_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos)
{
        return generic_file_aio_read(iocb, buf, count, pos);
}

ssize_t aggregate_file_aio_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos)
{
	return generic_file_aio_write(iocb, buf, count, pos);
}

int aggregate_nobh_commit_write(struct file *file, struct page *page, unsigned from, unsigned to)
{
	return nobh_commit_write(file, page, from, to);
}

ssize_t aggregate_do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos)
{
        return do_sync_read(filp, buf, len, ppos);
}
			
ssize_t aggregate_do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
{
        return do_sync_write(filp, buf, len, ppos);
}
				
ssize_t aggregate_file_readv(struct file *filp, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos)
{
        return generic_file_readv(filp, iov, nr_segs, ppos);
}
					
ssize_t aggregate_file_writev(struct file *filp, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos)
{
        return generic_file_writev(filp, iov, nr_segs, ppos);
}

ssize_t aggregate_seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
{
AGGREGATE_PRE(AGSOP_READ);
/* AGGREGATE_PRE is already inserted here */
{
ssize_t  retval;
	retval= seq_read(file, buf, size, ppos);
AGGREGATE_POST(AGSOP_READ);
return retval;
}
}

loff_t aggregate_seq_lseek(struct file *file, loff_t offset, int origin)
{
AGGREGATE_PRE(AGSOP_LLSEEK);
/* AGGREGATE_PRE is already inserted here */
{
loff_t  retval;
	retval= seq_lseek(file, offset, origin);
AGGREGATE_POST(AGSOP_LLSEEK);
return retval;
}
}

int aggregate_seq_release(struct inode *inode, struct file *file)
{
AGGREGATE_PRE(AGSOP_RELEASE);
{
int  retval;
	retval= seq_release(inode, file);
AGGREGATE_POST(AGSOP_RELEASE);
return retval;
}
}
